using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevComponents.DotNetBar;

namespace CuaHangDiaNhac
{
    public partial class frmMain : DevComponents.DotNetBar.Office2007RibbonForm
    {
        frmDiaNhac fDiaNhac = null;
        frmChiTietHoaDon fHoaDon = null;
        frmQuanLyHoaDon qlHoaDon = null;
        public frmMain()
        {
            XuLy.HienThiTienTrinh(this);
            InitializeComponent();
            XuLyForm.MaxSize(this);
            XuLy.HideTienTrinh(this);
        }

        private void btnDiaNhac_Click(object sender, EventArgs e)
        {
            if (fDiaNhac == null || fDiaNhac.IsDisposed)
            {
                fDiaNhac = new frmDiaNhac();
                fDiaNhac.MdiParent = frmMain.ActiveForm;
                fDiaNhac.WindowState = FormWindowState.Maximized;
                fDiaNhac.Show();
            }
            else
                fDiaNhac.Activate();
        }
        public void btnChiTietHoaDon_Click(object sender, EventArgs e)
        {
            if (fHoaDon == null || fHoaDon.IsDisposed)
            {
                fHoaDon = new frmChiTietHoaDon((int)sender);
                fHoaDon.MdiParent = frmMain.ActiveForm;
                fHoaDon.WindowState = FormWindowState.Maximized;
                fHoaDon.Show();
            }
            else
                fHoaDon.Activate();
        }

        //private void ribbonTabItem2_Click(object sender, EventArgs e)
        //{

        //}

        private void btnHoaDon_Click(object sender, EventArgs e)
        {
            if (qlHoaDon == null || qlHoaDon.IsDisposed)
            {
                qlHoaDon = new frmQuanLyHoaDon();
                qlHoaDon.MdiParent = frmMain.ActiveForm;
                qlHoaDon.WindowState = FormWindowState.Maximized;
                qlHoaDon.Show();
            }
            else
                qlHoaDon.Activate();

            //if (fHoaDon == null || fHoaDon.IsDisposed)
            //{
            //    fHoaDon = new frmChiTietHoaDon();
            //    fHoaDon.MdiParent = frmMain.ActiveForm;
            //    fHoaDon.WindowState = FormWindowState.Maximized;
            //    fHoaDon.Show();
            //}
            //else
            //fHoaDon.Activate();
        }


    }
}